package com.blood.core.util.http;

import com.blood.core.po.SysUserInfo;

/**
 * @author daoren
 * @description: 用户信息缓存
 * @date 2021/11/26 10:13
 */
public class RequestTheadUtils {
    /**
     * 用户信息
     */
    private static ThreadLocal<SysUserInfo> userInfo = new ThreadLocal();


    public RequestTheadUtils() {
    }

    public static void setInfo(SysUserInfo info) {
        userInfo.set(info);
    }

    public static String getRole() {
        return userInfo.get().getRole();
    }

    public static String getPlatform() {
        return userInfo.get().getPlatform();
    }

    public static String getOrgId() {
        return userInfo.get().getOrgId();
    }


    public static String getUserId() {
        return userInfo.get().getUserId();
    }

    public static String getDepartId() {
        return userInfo.get().getDepartId();
    }

    public static String getHospitalId() {
        return userInfo.get().getHospitalId();
    }

    public static String getUrl() {
        return userInfo.get().getUrl();
    }

    public static void remove() {
        userInfo.remove();
    }
}